﻿@inherits AdminCompontentBase
<div @ref="Ref">
    <SSimpleModal Value="@_visible" ValueChanged="HandleVisibleChanged" Title="@T("Permission.EditChannel")" HeaderClass="mr-4" BodyStyle="height: 597px;" SaveText="@T("Save")" OnCancel="HandleCancel" OnDelete="HandleDel" OnSave="async() => await Throttle(HandleOk)">
        <ChildContent>
            <MForm Model="_model" EnableValidation EnableI18n @ref="_form" Class="full-height">
                <MRow Class="row-box">
                    <MCol Md="6">
                        <STextField @bind-Value="_model.DisplayName"
                                    Label="@T("DisplayName.ChannelDisplayName")">
                        </STextField>
                    </MCol>
                    <MCol Md="6">
                        <STextField @bind-Value="_model.Code"
                                    Disabled
                                    Label="@T("DisplayName.ChannelCode")">
                        </STextField>
                    </MCol>
                    <MCol Md="12">
                        <SSelect @bind-Value="@_model.Type"
                                 Items="@channelTypeItems"
                                 Label="@T("DisplayName.ChannelType")"
                                 Readonly
                                 ItemText="item => T(item.ToString())"
                                 ItemValue="item => item"
                                 Disabled>
                        </SSelect>
                    </MCol>
                </MRow>
                <ChannelExtraProperties @ref="_channelExtraPropertiesRef" @bind-Value="_model.ExtraProperties" @bind-Type="_model.Type" />
                <MRow Class="row-box">
                    <MCol>
                        <div class="subtitle3 regular--text">@T("DisplayName.Color.Lable")</div>
                    </MCol>
                </MRow>
                <MRow Class="row-box">
                    <MCol>
                        <ColorsGroup @bind-Value="_model.Color" Colors='_colors' />
                    </MCol>
                </MRow>
                <MRow Class="row-box">
                    <MCol>
                        <MTextarea @bind-Value="_model.Description"
                                   Label="@T("DisplayName.ChannelDescription")"
                                   Outlined
                                   HideDetails="@("auto")">
                        </MTextarea>
                    </MCol>
                </MRow>
            </MForm>
        </ChildContent>
    </SSimpleModal>
</div>
